|
ARD2
1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
|
Side-project utilities that help with data manipulation. More...
Functions | |
| uint8_t | u8fnCheckOddParity (uint8_t u8Byte, uint8_t u8ParityPosition) |
| Checks a byte for odd parity. | |
| uint16_t | u16fnCheckOddParity (uint16_t u16Word, uint16_t u16ParityPosition) |
| Checks a 16-bit word for odd parity. | |
| uint32_t | u32fnCheckOddParity (uint32_t u32Word, uint32_t u32ParityPosition) |
| Checks a 32-bit word for odd parity. | |
| uint8_t | u8fnCRC8 (const uint8_t *pu8Buffer, uint8_t u8Poly, uint8_t u8MBitsize, uint8_t u8Remainder) |
| Compute a 8-bit CRC using a custom polynomial. | |
| void | vfnASCIIByteToHex (uint8_t *pu8Source, uint8_t *pu8Target, uint16_t u16NOfBytes) |
| Converts a data stream from ASCII words to HEX values. Note that Hex-values represented by two ASCII symbols are converted as two separate HEX values. | |
| void | vfnHexToASCIIMaskToList (const uint16_t cu16MaskList, uint8_t *pau8DataArray, uint16_t *pu16Index, const uint16_t cu16Mask) |
| Takes a mask list, and a particular mask value, and writes its position in ASCII in a given array, at the passed index position, followed by a comma and an empty space. | |
| void | vfnHexToASCII (uint8_t *pu8Source, uint8_t *pu8Target, uint16_t u16NOfBytes) |
| Converts a data stream from Hex to ASCII values. | |
| void | vfnCopyArray (uint8_t *pu8Source, uint8_t *pu8Target, uint16_t u16NOfBytes) |
| Copies an array to a different location using only code (no DMA). | |
| uint16_t | u16fnMaxU16DeltaInArray (const uint16_t *au16Array, uint8_t u8ArraySize) |
| Finds the max and the min values in a 16-bit array, and returns the difference between them. | |
| uint32_t | u32fnDiffAbsoluteValue (uint32_t au32Value1, uint32_t au32Value2) |
| Performs the absolute value of the difference between two numbers. | |
Variables | |
| const uint8_t | cau8OddParityTable [] |
Side-project utilities that help with data manipulation.
Copyright (c) 2011 Freescale Semiconductor Freescale Confidential Proprietary
History:
| uint16_t u16fnCheckOddParity | ( | uint16_t | u16Word, |
| uint16_t | u16ParityPosition | ||
| ) |
Checks a 16-bit word for odd parity.
| u16Word,: | Word to be checked for parity. |
| u16ParityPosition,: | If non-zero, adds the parity bit to the byte if needed. |
| uint16_t u16fnMaxU16DeltaInArray | ( | const uint16_t * | au16Array, |
| uint8_t | u8ArraySize | ||
| ) |
Finds the max and the min values in a 16-bit array, and returns the difference between them.
| au16Array,: | pointer to the array to be analized. |
| u8ArraySize,: | Number of elements in the array. |
| uint32_t u32fnCheckOddParity | ( | uint32_t | u32Word, |
| uint32_t | u32ParityPosition | ||
| ) |
Checks a 32-bit word for odd parity.
| u32Word,: | Word to be checked for parity. |
| u32ParityPosition,: | If non-zero, adds the parity bit to the byte if needed. |
| uint32_t u32fnDiffAbsoluteValue | ( | uint32_t | au32Value1, |
| uint32_t | au32Value2 | ||
| ) |
Performs the absolute value of the difference between two numbers.
| au32Value1,: | First number |
| au32Value2,: | Second number |
| uint8_t u8fnCheckOddParity | ( | uint8_t | u8Byte, |
| uint8_t | u8ParityPosition | ||
| ) |
Checks a byte for odd parity.
| u8Byte,: | Byte to be checked for parity. |
| u8ParityPosition,: | If non-zero, adds the parity bit to the byte if needed. |
| uint8_t u8fnCRC8 | ( | const uint8_t * | pu8Buffer, |
| uint8_t | u8Poly, | ||
| uint8_t | u8MBitsize, | ||
| uint8_t | u8Remainder | ||
| ) |
Compute a 8-bit CRC using a custom polynomial.
| pu8Buffer,: | Pointer to initial 8-bit element to check. |
| u8Poly,: | Polynomial associated to the division. |
| u8MBitsize,: | Number of bits to check. |
| void vfnASCIIByteToHex | ( | uint8_t * | pu8Source, |
| uint8_t * | pu8Target, | ||
| uint16_t | u16NOfBytes | ||
| ) |
Converts a data stream from ASCII words to HEX values. Note that Hex-values represented by two ASCII symbols are converted as two separate HEX values.
| pu8Source,: | Pointer to initial element to convert |
| pu8Target,: | Pointer to initial element in the target |
| u16NOfBytes,: | Size in bytes of stream to convert |
| void vfnCopyArray | ( | uint8_t * | pu8Source, |
| uint8_t * | pu8Target, | ||
| uint16_t | u16NOfBytes | ||
| ) |
Copies an array to a different location using only code (no DMA).
| pu8Source,: | Pointer to initial element to copy |
| pu8Target,: | Pointer to initial element to where to copy |
| u16NOfBytes,: | Size in bytes of stream to copy |
| void vfnHexToASCII | ( | uint8_t * | pu8Source, |
| uint8_t * | pu8Target, | ||
| uint16_t | u16NOfBytes | ||
| ) |
Converts a data stream from Hex to ASCII values.
| pu8Source,: | Pointer to initial element to convert |
| pu8Target,: | Pointer to initial element in the target |
| u16NOfBytes,: | Size in bytes of stream to convert |
| void vfnHexToASCIIMaskToList | ( | const uint16_t | cu16MaskList, |
| uint8_t * | pau8DataArray, | ||
| uint16_t * | pu16Index, | ||
| const uint16_t | cu16Mask | ||
| ) |
Takes a mask list, and a particular mask value, and writes its position in ASCII in a given array, at the passed index position, followed by a comma and an empty space.
| cu16MaskList,: | Mask list containing element to evaluate. |
| pau8DataArray,: | Array were the result will be written. |
| pu16Index,: | Location where the ASCII value will be written. It will be updated to the next free location after the call. |
| cu16Mask,: | Mask value to compare the cu16MaskList against. |
| const uint8_t cau8OddParityTable[] |
{
0u, 1u, 1u, 0u, 1u, 0u, 0u, 1u, 1u, 0u, 0u, 1u, 0u, 1u, 1u, 0u
}